﻿using Microsoft.Xna.Framework;

namespace block_explorer.Util
{
    public class LineSegment
    {
        private Vector3 mStart;
        private Vector3 mEnd;

        public Vector3 Start { get { return mStart; } set { mStart = value; } }
        public Vector3 End { get { return mEnd; } set { mEnd = value; } }
        public Vector3 Dir
        {
            get
            {
                Vector3 dir = End - Start;
                dir.Normalize();
                return dir;
            }
        }

        public Ray Ray { get { return new Ray(Start, Dir); } }

        public LineSegment()
        {
            mStart = Vector3.Zero;
            mEnd = Vector3.One;
        }

        public LineSegment(Vector3 start, Vector3 end)
        {
            mStart = start;
            mEnd = end;
        }
    }
}
